make "halt -p" and "shutdown -h now" work. Also added apm 0x05 CPU
idle, 0x08 Enable PM and 0x0f apm engage/disengage subfunctions.
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
; APM interface disconnect
APMSYM(04):
cmp al, #0x04
+ jne APMSYM(05)
+ jmp APMSYM(ok)
+
+;-----------------
+; APM cpu idle
+APMSYM(05):
+ cmp al, #0x05
jne APMSYM(07)
+ hlt
jmp APMSYM(ok)
;-----------------
; APM Set Power State
APMSYM(07):
cmp al, #0x07
- jne APMSYM(0a)
+ jne APMSYM(08)
cmp bx, #1
jne APMSYM(ok)
pop edx
jmp APMSYM(ok)
+;-----------------
+; APM Enable / Disable
+APMSYM(08):
+ cmp al, #0x08
+ jne APMSYM(0a)
+
+ jmp APMSYM(ok)
+
;-----------------
; Get Power Status
APMSYM(0a):
; APM Driver Version
APMSYM(0e):
cmp al, #0x0e
- jne APMSYM(unimplemented)
+ jne APMSYM(0f)
mov ah, #1
mov al, #2
jmp APMSYM(ok)
+;-----------------
+; APM Engage / Disengage
+APMSYM(0f):
+ cmp al, #0x0f
+ jne APMSYM(10)
+
+ jmp APMSYM(ok)
+
+;-----------------
+; APM Get Capabilities
+APMSYM(10):
+ cmp al, #0x10
+ jne APMSYM(unimplemented)
+
+ mov bl, #0
+ mov cx, #0
+
+ jmp APMSYM(ok)
+
;-----------------
APMSYM(ok):
popf
#define BX_SUPPORT_FLOPPY 1
#define BX_FLOPPY_ON_CNT 37 /* 2 seconds */
#define BX_PCIBIOS 1
-#define BX_APM 0
+#define BX_APM 1
#define BX_USE_ATADRV 1
#define BX_ELTORITO_BOOT 1